<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="com.netcombine.freewill.constants.*, com.netcombine.freewill.vo.FreewillVo, com.netcombine.freewill.lib.Paging,com.netcombine.freewill.vo.PagingVo"%>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
Paging paging = (Paging)request.getAttribute("paging");

PagingVo vo = (PagingVo)request.getAttribute("pagingVo"); 


int total_cnt = paging.getTotalCnt();

String searchName = "";
String searchWord = "";
String help_idx = "";

if(vo != null){
	searchName = vo.getSearchName() == null ? "" : vo.getSearchName();
	searchWord = vo.getSearchWord() == null ? "" : vo.getSearchWord();
}
%>
<html>
<head>
	
	<title><%=PageInfo.TITLE%> - 도움말</title>
<tiles:insertDefinition name="_head" />
	
</head>

<body>
	<div class="wrap">
		
		<tiles:insertDefinition name="_header" />

<!-- Container -->
<div class="container">
<div>
	
	<!-- LNB -->
<tiles:insertDefinition name="_menu" />
<!-- LNB  //-->

<!-- Content -->
<div class="content">
	
	<!-- locatioin -->
<div class="location">
	<h1>도움말 관리</h1>
	<ul>
		<li class="home"><a href="#none"><span>home</span></a> &gt;</li>
		<li><a href="#none"><span>게시판 관리</span></a> &gt;</li>
		<li><strong>도움말</strong></li>
	</ul>
</div>
<!-- locatioin // -->
<form name="searchForm" method="POST">
<!-- member_search -->
<div class="member_search">
	<table summary="도움말 관리, 검색기간, 검색설정">
		<caption>도움말 관리</caption>
		<colgroup>
			<col style="width:15%">
<col style="width:*;">
<col style="width:15%">
</colgroup>
<tbody>
	<tr>
		<th>게시일</th>
		<td>
			<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
			<script type="text/javascript" src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
			<script type="text/javascript">
$(function() {
	  $( "#startday" ).datepicker({
	  showOn: "button",
	  buttonImage: "<%= PageInfo.IMG_PATH %>/icon_calendar.png",
	  buttonImageOnly: true,
	  dateFormat:"yy-mm-dd",
	  defaultDate: "+1w",
	  changeMonth: true,
	  numberOfMonths: 1,
	  onClose: function( selectedDate ) {
	  $( "#lastday" ).datepicker( "option", "minDate", selectedDate );
  }
});
	  $( "#lastday" ).datepicker({
      showOn: "button",
  	  buttonImage: "<%= PageInfo.IMG_PATH %>/icon_calendar.png",
	  buttonImageOnly: true,
	  dateFormat:"yy-mm-dd",
	  defaultDate: "+1w",
	  changeMonth: true,
	  numberOfMonths: 1,
	  onClose: function( selectedDate ) {
		$( "#startday" ).datepicker( "option", "maxDate", selectedDate );
	  }
	});
});
function searchFrm(){
	frm = document.searchForm;
	
	frm.action = "<%= request.getContextPath() %>/help/list.do";
	frm.submit();
	
}
</script>
	<input type="text" id="startday" name="startday" title="검색 시작날짜" class="i_text inw8" /> ~ 
	<input type="text" id="lastday" name="lastday" title="검색 마지막날짜" class="i_text inw8" />
	</td>
	<td rowspan="3" class="txtC"><span class="btn_member bgnone"><a href="javascript: searchFrm();">검색</a></span></td>
	</tr>
<tr>
		<th>도움말 분류</th>
			<td>
					<select>
						<option>전체</option>
					</select>
				</td>
			</tr>
			<tr>
				<th>
					<select>
						<option>제목</option>
						<option>내용</option>
					</select>
				</th>
				<td><input type="text" title="검색" class="i_text inw3"></td>
			</tr>
		</tbody>
	</table>
</div>
<!-- member_search // -->
</form>
<!-- search detail -->
<div class="search_detail">
	<p class="txt">총 <span><%=total_cnt %></span> 건</p>
	<p class="right btn_excel"> <a href="#none">EXCEL 저장</a></p>
</div>
<!-- search detail // -->

<!-- table -->
<div class="tb_list1">
	<table summary="번호, 분류, 제목, 등록일, 게시여부, 조회수">
		<caption>도움말 리스트</caption>
		<colgroup>
			<col style="width:6%;">
			<col style="width:10%;">
			<col style="width:10%;">
			<col style="width:*;">
			<col style="width:11%;">
			<col style="width:9%;">
			<col style="width:10%;">
		</colgroup>
		<thead>
		<tr>
			<th scope="col"><div><input class="i_check" type="checkbox" value="" title="리스트체크"></div></th>
			<th scope="col"><div>No.</div></th>
			<th scope="col"><div>분류</div></th>
			<th scope="col"><div>제목</div></th>
			<th scope="col"><div>등록일</div></th>
			<th scope="col"><div>게시여부</div></th>
			<th scope="col"><div>조회수</div></th>
		</tr>
		</thead>
		<tbody>
		<%
				if (total_cnt != 0) {
		%>
				<c:forEach items="${helpList}" var="vo" >
					<tr>
						<td><c:out value="${vo.help_idx}"/></td>
						<td><c:out value="${vo.help_title}"/> </td>
						<td><c:out value="${vo.help_contents}" /></td>
						<td><c:out value="${vo.help_regdate}" /></td>
						<td><c:out value="${vo.help_useyn}" /></td>
						<td><c:out value="${vo.help_hitcnt}" /></td>
					</tr>
				</c:forEach>
				
		<%
		} 
		%>		
		</tbody>
	</table>
</div>
<!-- table // -->

<!-- btn -->
<div class="btn_allbox">
	<div class="btn_box flL"> 
		<span class="btn_gray1"><a href="#none">선택삭제</a></span>
	</div>				
	<div class="btn_box flR"> 
		<span class="btn_gray1"><a href="bbs_help_w.php">등록</a></span>
	</div>
</div>
<!-- btn // -->

<!-- paging -->
${paging.getPagingHtml()}
<!-- paging // -->

</div>
<!-- Content // -->
</div>
</div>
<!-- Container // -->
</div>
<form name="pageForm" method="POST">
<input type="hidden" name="page" value="${pagingVo.page}"/>
<input type="hidden" name="searchName" value="${pagingVo.searchName}"/> 
<input type="hidden" name="searchWord" value="${pagingVo.searchWord}" />
</form>
</body>
</html>